package ooday02;

public class Test {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小黑",2,"黑");
        dogs[1] = new Dog("小白",1,"白");
        dogs[2] = new Dog("小灰",3,"灰");
        System.out.println(dogs[0].name);
        dogs[2].age = 4;
        dogs[2].lookHome();
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }






        /*Dog hd = new Dog("黑豆", 3, "黑");
        hd.eat();
        hd.drink();
        hd.lookHome();


        Chick xw = new Chick("坤坤", 23, "黄");
        xw.eat();
        xw.drink();
        xw.layEgg();

        Fish xj = new Fish("小金", 2, "金");
        xj.eat();
        xj.drink();*/
    }
}
